<?php
    include('../init.php');
    
    foreach($_POST as $k=>$v){
        $$k = $v;
    }
    
    $result = $db->query("UPDATE hs_member SET m_password=MD5('$userPass') WHERE m_id=$m_id");
    
    if(!$result){
        echo $status_msg['email_dont_exist'];
    }else{
        $time_ = time();
        $seccode = md5($time_);
        $sql = "UPDATE hs_member SET m_seccode='' WHERE m_id=$m_id";
        $result = $db->query($sql);
        
        if($result){
            echo 'success';
        }else{
            echo $status_msg['cant_add'];
        }
    }
?>